package org.goochasca

private[goochasca] object Utils {
  def maxDataPoint(data: Seq[Data]): Int = {
    var max = Integer.MIN_VALUE
    for (d <- data; i <- d.data)
      max = Math.max(max, i)
    max
  }
  
  def flatten(data: Seq[(Data, Data)]): Seq[Data] = {
    val array = new Array[Data](data.size*2)
    var idx = 0
    for (t <- data) {
      array(idx) = t._1
      idx += 1
      array(idx) = t._2
      idx += 1
    }
    array
  }
}
